#include <stdio.h>
int main()
{
	int data[8] = {1, 2, 3, 4, 5, 6, 7, 8};
	int m = 5;
	int dataMoved[8] = {0};
	for (int i = 0; i <= 7; i++)
	{
		printf("%d ", data[i]);
	}
	for (int i = 0; i <= m - 1; i++)
	{
		dataMoved[i] = data[8 - m + i];
	}
	for (int i = 0; i <= 8 - m - 1; i++)
	{
		dataMoved[m + i] = data[i];
	}
	printf("\n");
	for (int i = 0; i <= 7; i++)
	{
		printf("%d ", dataMoved[i]);
	}
}

